package com.example.android427;

import android.app.Application;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

import androidx.appcompat.app.AppCompatActivity;

import com.example.android427.Fragment.shujiaFragment;

public class shipinActivity extends AppCompatActivity implements View.OnClickListener {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.shipin);
        Button shipin_b1= (Button)findViewById(R.id.shipin_b1);
        shipin_b1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(shipinActivity.this, MainActivity.class);
                startActivity(intent);
            }
        });
        ImageButton jingyun = (ImageButton) findViewById(R.id.jingyu_bt);
        ImageButton shushi = (ImageButton) findViewById(R.id.shushi_bt);
        ImageButton siheyuan = (ImageButton) findViewById(R.id.siheyuan_bt);
        ImageButton yaoyuan = (ImageButton) findViewById(R.id.yaoyuan_bt);
        ImageButton kangxi = (ImageButton) findViewById(R.id.kangxi_bt);
        ImageButton shanchuan = (ImageButton) findViewById(R.id.shanchuan_bt);

        jingyun.setOnClickListener(this);
        shushi.setOnClickListener(this);
        siheyuan.setOnClickListener(this);
        yaoyuan.setOnClickListener(this);
        kangxi.setOnClickListener(this);
        shanchuan.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent(shipinActivity.this, BofangActivity.class);
        switch (v.getId()){
            case R.id.jingyu_bt:
                intent.putExtra("data1","京韵大鼓");
                startActivity(intent);
                break;
            case R.id.shushi_bt:
                intent.putExtra("data1","北京最大的书市");
                startActivity(intent);
                break;
            case R.id.siheyuan_bt:
                intent.putExtra("data1","北京四合院");
                startActivity(intent);
                break;
            case R.id.yaoyuan_bt:
                intent.putExtra("data1","历史并不遥远");
                startActivity(intent);
                break;
            case R.id.kangxi_bt :
                intent.putExtra("data1","康熙王朝");
                startActivity(intent);
                break;
            case R.id.shanchuan_bt:
                intent.putExtra("data1","山川上的中国");
                startActivity(intent);
                break;
            default:
                break;
        }
    }
}
